package part18.test;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

/**
 * @author wcj
 * @Date 2021/6/4 18:07
 * @Version 1.0
 */
public class DeserializableObject {

 /**
  * 序列化的对象可以写入到文件中，之后可以进行反序列化
  *
  * @param args
  * @throws Exception
  */
 public static void main(String[] args) throws Exception {
  ObjectInputStream in = new ObjectInputStream(new FileInputStream("./src/part18/test/serializableObject.file"));
  ObjectSerializable objectSerializable = (ObjectSerializable) in.readObject();
  System.out.println(objectSerializable.size);
  System.out.println(objectSerializable.getClass());
 }
}
